﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MyVerify : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userinfo"] == null)
        {
            Response.Redirect("Default.aspx");
            return;
        }
        if (!IsPostBack)
        {
            if (gvMyVerify.Rows.Count != 0)
            {
                DVNoData.Visible = false;
            }
            else
            {
                DVNoData.Visible = true;
            }
        }
    }
    protected void gvMyVerify_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowIndex > -1)
        {

            if (((CheckBox)e.Row.Cells[2].Controls[0]).Checked)
            {
                e.Row.Cells[2].Text = "<img src=\"Images/yes.png\" />";
            }
            else
            {
                e.Row.Cells[2].Text = "";
            }
        }
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        GridViewRow row = ((Button)sender).NamingContainer as GridViewRow; //得到点击更新的行号
        string cmd = string.Format(@"Update ViewLog set NeedConfirm = false,CThisJob = false,CEmpID = null,CDate = null
                                        where [No]={0}",
                                   row.Cells[0].Text);
        DBOperate myDB = new DBOperate();
        myDB.SetCommandString(cmd);
        myDB.ExecuteNonReader();
        myDB.CloseDB();
        Response.Redirect("MyVerify.aspx");
    }
}
